﻿@model DealKhuyenMaiV2.com.Models.TongQuan
@{
    ViewBag.Title = "Trang Chủ Admin";
    Layout = "~/Views/Admin/Shared/_AdminLayout.cshtml";
    IEnumerable<DealKhuyenMaiV2.com.Models.Order> orders = Model.TopSeller;
}
<head>
    <script src="../../../Scripts/js/highcharts.js"></script>
    <script src="../../../Scripts/js/modules/exporting.js"></script>
</head>
<body>
    <div class="breadcrumb">
        @Html.ActionLink("Trang Chủ", "Index", "Admin")
    </div>
    <div class="box">
        <div class="left">
        </div>
        <div class="right">
        </div>
        <div class="heading">
            <h1 style="background-image: url(view/image/home.png);">
                Bảng Quản trị
            </h1>
        </div>
        <div class="content">
            <div style="display: inline-block; width: 100%; margin-bottom: 15px; clear: both;">
                <div style="float: left; width: 49%;">
                    <div style="border-bottom: 1px solid rgb(142, 174, 195); padding: 5px; background: rgb(84, 124, 150) none repeat scroll 0% 0%;
                        -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;
                        color: rgb(255, 255, 255); font-size: 14px; font-weight: bold;">
                        Tổng quan</div>
                    <div style="border: 1px solid rgb(142, 174, 195); padding: 10px; background: rgb(252, 252, 252) none repeat scroll 0% 0%;
                        -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;
                        height: 180px;">
                        <table style="width: 100%;" cellpadding="2">
                            <tbody>
                                <tr>
                                    <td width="80%">
                                        Tổng số bán hàng:
                                    </td>
                                    <td align="right">
                                        @Model.TongBanHang VNÐ
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tổng số bán hàng trong nam:
                                    </td>
                                    <td align="right">
                                        @Model.TongBanHangTrongNam VNÐ
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tổng số đơn đặt hàng:
                                    </td>
                                    <td align="right">
                                        @Model.TongDonDatHang
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tổng số khách hàng:
                                    </td>
                                    <td align="right">
                                        @Model.TongKhachHang
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Đơn hàng chờ duyệt:
                                    </td>
                                    <td align="right">
                                        @Model.DonHangChoDuyet
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tổng số sản phẩm
                                    </td>
                                    <td align="right">
                                        @Model.TongSanPham
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Tổng số nhận xét:
                                    </td>
                                    <td align="right">
                                        @Model.TongNhanXet
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div style="float: right; width: 49%;">
                    <div style="border-bottom: 1px solid rgb(142, 174, 195); background: rgb(84, 124, 150) none repeat scroll 0% 0%;
                        -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;
                        color: rgb(255, 255, 255);">
                        <div style="width: 100%; display: inline-block;">
                            <div style="padding: 7px 0px 0px 5px; float: left; font-size: 14px; font-weight: bold;
                                line-height: 12px;">
                                Thống kê</div>
                            <div style="padding: 2px 5px 0px 0px; float: right; font-size: 12px;">
                                Chọn Phạm vi:
                                @using (Html.BeginForm("Index", "Admin", FormMethod.Post))
                                {
                 
                                    @Html.DropDownList("range", ViewBag.ListTime as SelectList, new { onchange = "this.form.submit();", @stype = "margin: 2px 3px 0pt 0pt;" })
                
                                }
                            </div>
                        </div>
                    </div>
                    <div style="border: 1px solid rgb(142, 174, 195); padding: 10px; background: rgb(252, 252, 252) none repeat scroll 0% 0%;
                        -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;
                        height: 49%;">
                        <div id="Chart">
                            @{ Html.RenderPartial("BasicLine", Model.Chart);}
                        </div>
                    </div>
                </div>
            </div>
            <div>
                <div style="border-bottom: 1px solid rgb(142, 174, 195); padding: 5px; background: rgb(84, 124, 150) none repeat scroll 0% 0%;
                    -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;
                    color: rgb(255, 255, 255); font-size: 14px; font-weight: bold;">
                    10 đặt hàng mới nhất</div>
                <div style="border: 1px solid rgb(142, 174, 195); padding: 10px; background: rgb(252, 252, 252) none repeat scroll 0% 0%;
                    -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
                    <table class="list">
                        <thead>
                            <tr>
                                <td class="right">
                                    ID Ðon hàng
                                </td>
                                <td class="left">
                                    Tên khách hàng
                                </td>
                                <td class="left">
                                    Hiện trạng
                                </td>
                                <td class="left">
                                    Ngày thêm
                                </td>
                                <td class="right">
                                    Tổng
                                </td>
                            </tr>
                        </thead>
                        @{if (orders != null)
                          {
                              foreach (var item in orders)
                              {
                            <tr>
                                <td class="right">
                                    @item.IDOrder
                                </td>
                                <td class="left">
                                    @item.Account.FullName
                                </td>
                                <td class="left">
                                    @item.StatusOrder.NameStatus
                                </td>
                                <td class="left">
                                    @item.DateAdded
                                </td>
                                <td class="right">
                                    @item.Total
                                </td>
                            </tr> 
                              }
                          }
                          else
                          {
                            <tr>
                                <td class="center" colspan="6">
                                    Không có kết quả!
                                </td>
                            </tr>
                          }
                        }
                    </table>
                </div>
            </div>
        </div>
    </div>
